<template>
    <fieldset>
        <legend>其他组件</legend>
        <h1>{{ userStore.username }}</h1>
        <h1>reverseName:{{ reverseName }}</h1>
        <h1>newArr:{{ newArr }}</h1>
        <h1>newCount:{{ newCount(10) }}</h1>
        <ul>
            <li v-for="item in data" :key="item.id">{{ item.name }}</li>
        </ul>
    </fieldset>
</template>

<script setup>
import { useUser } from '../store/users'
import { storeToRefs } from 'pinia'
let userStore = useUser()

let { reverseName, newArr, newCount, data } = storeToRefs(userStore)

// 调用action的方法
userStore.fetch_data(1, 2)
</script>